#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
	int a = 0, b = 0, c = 0, d = 0;
	for (a = 100; a <= 999; a++)
	{
		b = (a % 10);
		c = (a / 10 % 10);
		d = (a / 100);
		if (a == b*b*b + c*c*c + d*d*d)
			printf("%d ", a);

	}
	return 0;
}